class Event {
  String name
  String description
  Date startDate
  Date endDate
  String location
  Volunteer owner

  static hasMany = [positions: EventPosition]

  static constraints = {
      name(blank:false)
      description(blank:false)
      startDate(blank:false)
      endDate(blank:false,
          validator: {
            val, obj ->
                if(val != null) {
                  return val.after(obj.startDate)
                }
            return true
          })
      owner(blank:false)
  }

  String toString() {
    name
  }
}
